package com.ruoyi.business.domain.bo.admin;

import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.Type1Group;
import com.ruoyi.common.core.validate.Type2Group;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 运单新增司机和费用bo
 */
@Data
public class AdminWayBillFeeBo {

    /**
     * 运单id
     */
    @NotNull(message = "运单id不能为空", groups = {EditGroup.class})
    private Long freightId;

    /**
     * 司机类型
     */
    @NotNull(message = "司机类型不能为空", groups = {AddGroup.class,EditGroup.class})
    private String driverType;

    /**
     * 二级中转地址
     */
    private String secondLevelAddress;

    /**
     * 二级中转经度
     */
    private String secondLevelLongitude;

    /**
     * 二级中转纬度
     */
    private String secondLevelLatitude;

    /**
     * 二级中转联系人
     */
    private String secondLevelLinkman;

    /**
     * 二级中转联系电话
     */
    private String secondLevelTel;

    /**
     * 司机电话
     */
    @NotNull(message = "司机电话不能为空", groups = {AddGroup.class,EditGroup.class})
    @NotBlank(message = "司机电话不能为空", groups = {AddGroup.class,EditGroup.class})
    private String driverTel;

    /**
     * 司机姓名
     */
    @NotNull(message = "司机姓名不能为空", groups = {AddGroup.class,EditGroup.class})
    @NotBlank(message = "司机姓名不能为空", groups = {AddGroup.class,EditGroup.class})
    private String driverName;

    /**
     * 运输费用
     */
    @NotNull(message = "运输费用不能为空", groups = {AddGroup.class,EditGroup.class})
    @Digits(integer = 8, fraction = 2, message = "运输费用超出最大金额", groups = {AddGroup.class, EditGroup.class,Type1Group.class, Type2Group.class})
    @DecimalMin(value = "0.01", message = "运输费用不能低于0.01元", groups = {AddGroup.class, EditGroup.class,Type1Group.class, Type2Group.class})
    private BigDecimal freightAmount;


}
